package com.lakeworks.web.controller.core;

import com.lakeworks.common.core.controller.BaseController;
import com.lakeworks.common.core.domain.AjaxResult;
import com.lakeworks.service.ISysAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 附件基本信息Controller
 *
 * @author lake
 * @date 2023-02-08
 */
@RestController
@RequestMapping("/system")
public class SysAttachmentController extends BaseController {
    @Autowired
    private ISysAttachmentService sysAttachmentService;

    /**
     * 查询附件基本信息列表
     */
    @GetMapping("/attachments")
    public AjaxResult list() {
        return AjaxResult.success(sysAttachmentService.attachmentList());
    }

    @GetMapping("/attachment/{id}")
    public AjaxResult selectById(@PathVariable("id") Long id) {

        return success(sysAttachmentService.selectSysAttachmentById(id));
    }

}
